<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<?php if($model->isNewRecord):?>
	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>255, 'autocomplete'=>'off')); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>
	<?php endif;?>


	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->DropDownList($model,'title',DataUtil::getTitles(),array('empty'=>'')); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstName'); ?>
		<?php echo $form->textField($model,'firstName',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'firstName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lastName'); ?>
		<?php echo $form->textField($model,'lastName',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'lastName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'contactPhone'); ?>
		<?php echo $form->textField($model,'contactPhone',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'contactPhone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'teamId'); ?>
		<?php echo $form->DropDownList($model,'teamId',Team::getArray(),array('empty'=>'')); ?>
		<?php echo $form->error($model,'teamId'); ?>
	</div>

<?php if(!$model->isNewRecord):?>
	<div class="row">
		<?php echo $form->labelEx($model,'active'); ?>
		<?php echo $form->checkBox($model,'active',array()); ?>
		<?php echo $form->error($model,'active'); ?>
		<span class="hint">If checked, this user can login to the system. If NOT checked, the user cannot login to the system.</span>
	</div>
<?php endif;?>
<?php /*
	<div class="row">
		<?php echo $form->labelEx($model,'globalView'); ?>
		<?php echo $form->checkBox($model,'globalView',array()); ?>
		<?php echo $form->error($model,'globalView'); ?>
		<span class="hint">If checked, this user can view all customers' data.</span>
	</div>
*/?>
	<div class="row">
		<?php echo $form->labelEx($model,'teamLeader'); ?>
		<?php echo $form->checkBox($model,'teamLeader',array()); ?>
		<?php echo $form->error($model,'teamLeader'); ?>
		<span class="hint">If checked, this user is the team leader for the user's current team.</span>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->